<template>
  <div :class="Toggle == '1' ? 'age-body' : 'age-Editor'">
    <div class="Job-body" v-if="Toggle == '1'">
      <div>离职-想找工作</div>
      <div>
        <i class="el-icon-edit-outline" @click="handelClick"></i>
        <span @click="handelClick">编辑</span>
      </div>
    </div>
    <div class="Editor-body" v-if="Toggle == '2'">
      <p class="title">求职状态</p>
      <div class="sex_box">
        <div
          v-for="(item, index) in dataArr"
          :key="index"
          :class="[ele == item.id ? 'Select' : 'Unchecked']"
          @click="handelEle(item.id)"
        >
          {{ item.name }}
        </div>
      </div>
      <div class="bottom">
        <p @click="handelOff(2)">取消</p>
        <p @click="handelOff(1)">确认</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Toggle: "1",
      dataArr: [
        { name: "离职-想找工作", id: "1" },
        { name: "在职-想换工作", id: "2" },
        { name: "在职-寻找机会", id: "3" },
        { name: "在职-不考虑", id: "4" },
      ],
      ele: "1",
    };
  },
  components: {},
  methods: {
    handelClick() {
      this.Toggle = "2";
    },
    // 切换
    handelEle(num) {
      this.ele = num;
    },
    // 取消/确认
    handelOff(num) {
      if (num == 1) {
        this.Toggle = "1";
      } else {
        this.Toggle = "1";
      }
    },
  },
};
</script>

<style scoped lang="less">
.age-body {
  width: 100%;
  height: 100%;
  display: flex;
  .Job-body {
    width: 100%;
    display: flex;
    justify-content: space-between;
    i {
      font-size: 21px;
      vertical-align: middle;
    }
  }
}
.age-Editor {
  width: 100%;
  height: 100%;
  display: flex;
  background-color: #f8f8f8;
  .Editor-body {
    width: 94%;
    margin: 0 auto;
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    .title {
      height: 30px;
      line-height: 30px;
      font-size: 15px;
      font-weight: 600;
    }
    // 性别选择
    .sex_box {
      width: 100%;
      height: 35px;
      display: flex;
      margin-top: 10px;
      font-size: 14px;
      color: #3894ff;
      .Select {
        min-width: 100px;
        min-height: 30px;
        border-radius: 5px;
        line-height: 30px;
        text-align: center;
        border: 1px solid #c4e1fe;
        background-color: #e6f1fc;
        cursor: pointer;
        margin-left: 20px;
      }
      .Unchecked {
        min-width: 100px;
        min-height: 30px;
        border-radius: 5px;
        line-height: 30px;
        text-align: center;
        border: 1px solid #c4e1fe;
        background-color: #ffffff;
        cursor: pointer;
        margin-left: 20px;
      }
      div:nth-child(1) {
        margin-left: 0px;
      }
    }
    .bottom {
      width: 100%;
      height: 35px;
      display: flex;
      justify-content: flex-end;
      p {
        width: 80px;
        height: 35px;
        background-color: #3894ff;
        border-radius: 5px;
        line-height: 35px;
        text-align: center;
        color: #ffffff;
      }
      p:nth-child(1) {
        background-color: #919191;
        margin-right: 20px;
      }
    }
  }
}
</style>
